#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

vector<vector<int> > threeSum(vector<int> &num) {
    sort(num.begin(), num.end());
    vector<vector<int> > ans; 
    set<vector<int> > mySet;
    if (num.size() < 3) return ans;
    for (int i = 0; i < num.size()-2; i++) {
        int needSum = 0 - num[i];
        int j, k;
        for (j = i+1, k = num.size()-1; j < k; ) {
            int curSum = num[j] + num[k];
            if (curSum < needSum) j++;
            else if (curSum == needSum) {
                vector<int> tmp;
                tmp.push_back(num[i]);
                tmp.push_back(num[j]);
                tmp.push_back(num[k]);
                if (mySet.count(tmp) == 0) {
                    ans.push_back(tmp);
                    mySet.insert(tmp);
                }
                j++;
                k--;
            } else {
                k--;
            }
        }
    }
    return ans;
}

int main(int argc, char **argv)
{

    cout << "-----------------Test 1--------------------" << endl;


    cout << "-----------------Test 2--------------------" << endl;


    cout << "-----------------Test 3--------------------" << endl;


    cout << "-----------------Test 4--------------------" << endl;


    cout << "-----------------Test 5--------------------" << endl;



}
